<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2022-11-24
 * Time: 8:28
 */

namespace App\server\dtk;


use support\exception\BaseException;

abstract class BaseAbstract
{
    //请求公众url
    private  const URL='https://openapi.dataoke.com/';
    protected $url;
    //请求数据
    public $data=array();
    //返回请求连接
    private  function getUrl()
    {
        if($this->url){
            return self::URL.$this->url;
        }
        throw new BaseException('请传入请求地址');
    }

    public function get($appId)
    {
        $d=new DtkClient($this->getUrl(),$this->data,$appId);
        return json_decode($d->getBody(),true);

    }
}